﻿@model List<Live>
@inject NetCoreCMS.IServices.IUsersService _users
@{
    Layout = null;
    Sysconfig config = ViewData["config"] as Sysconfig;
}
<!DOCTYPE html>
<!--HTML5 doctype-->
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title>直播列表</title>
    <link rel="stylesheet" type="text/css" href="/css/pagination.css" />
    <link rel="stylesheet" type="text/css" href="/mobile/css/style.css" />
    <script type="text/javascript" charset="utf-8" src="/mobile/js/zepto.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/mobile/js/weui.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/mobile/js/common.js"></script>
</head>

<body ontouchstart>
    <div class="page">
        <!--页面头部-->
        <div class="header">
            <a class="back" href="javascript:history.back();">
                <i class="iconfont icon-arrow-left"></i>
            </a>
            <h3>主播中心</h3>
            <div class="right">
                <a class="weui-cell_access weui-cell_link" onclick="javascript:;">
                    <i class="iconfont icon-video"></i>
                </a>
            </div>
        </div>
        <!--/页面头部-->
        <!--页面内容-->
        <div class="page__bd">
            <!--商品列表-->
            <div class="weui-panel weui-panel_access" style="margin-top:10px;">
                <div class="weui-panel__hd">主播中心</div>
                <div class="weui-panel__bd">
                    <div class="img-list">
                        <ul>
                            <!--取得一个分页DataTable-->
                            @foreach (Live dr in Model)
                            {
                                <li>
                                    <div class="wrap">
                                        @if (dr.online == 1)
                                        {
                                            <span class="number">直播中</span>
                                        }
                                        else if (dr.online == 0)
                                        {
                                            <span class="number">停止</span>
                                        }
                                        <a asp-action="Show" asp-route-id="@dr.id">
                                            <img src="@dr.img_url" />
                                            <div class="note">
                                                <h2>@dr.title</h2>
                                                <p>
                                                    <i class="hot"></i>
                                                    @{ 
                                                        var user = _users.GetModel(dr.user_id);
                                                        string username = "系统";
                                                        if (user != null)
                                                            username = user.user_name;
                                                    }
                                                    <i class="price">主播：@username</i>
                                                </p>
                                            </div>
                                        </a>
                                    </div>
                                </li>
                            }
                        </ul>
                    </div>

                </div>
            </div>
            <!--/商品列表-->
            <!--分页页码-->
            <div class="page-list">
                @Html.Raw(ViewBag.pagelist)
            </div>
            <!--/分页页码-->
            <!--版权信息-->
            @await Html.PartialAsync("~/Areas/Web/Views/Shared/_Copyright.cshtml")
            <!--/版权信息-->
            <!--底部导航-->
            @await Html.PartialAsync("~/Areas/Web/Views/Shared/_Footer.cshtml")
            <!--/底部导航-->
        </div>
        <!--/页面内容-->
    </div>


</body>
</html>
